﻿using DevExpress.Xpo;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model.Bill
{
    public class TB_Order : BaseXPLiteObjectClass
    {
        public TB_Order(Session session) : base(session) { }
        public override void AfterConstruction()
        {
            base.AfterConstruction();
        }
        string fOrderID;
        [Key, Persistent]
        public string OrderID
        {
            get { return fOrderID; }
            set { SetPropertyValue<string>("OrderID", ref fOrderID, value); }
        }
        string fBillCode;
        public string BillCode
        {
            get { return fBillCode; }
            set { SetPropertyValue<string>("BillCode", ref fBillCode, value); }
        }
        int fStatusID;
        public int StatusID
        {
            get { return fStatusID; }
            set { SetPropertyValue<int>("StatusID", ref fStatusID, value); }
        }
        int fTypeID;
        public int TypeID
        {
            get { return fTypeID; }
            set { SetPropertyValue<int>("TypeID", ref fTypeID, value); }
        }
        int fPayStatusID;
        public int PayStatusID
        {
            get { return fPayStatusID; }
            set { SetPropertyValue<int>("PayStatusID", ref fPayStatusID, value); }
        }
        B_Store fStoreID;
        public B_Store StoreID
        {
            get { return fStoreID; }
            set { SetPropertyValue<B_Store>("StoreID", ref fStoreID, value); }
        }
        B_Provider fProviderID;
        public B_Provider ProviderID
        {
            get { return fProviderID; }
            set { SetPropertyValue<B_Provider>("ProviderID", ref fProviderID, value); }
        }
        DateTime fSellDate;
        public DateTime SellDate
        {
            get { return fSellDate; }
            set { SetPropertyValue<DateTime>("SellDate", ref fSellDate, value); }
        }
        DateTime fDeliveryDate;
        public DateTime DeliveryDate
        {
            get { return fDeliveryDate; }
            set { SetPropertyValue<DateTime>("DeliveryDate", ref fDeliveryDate, value); }
        }
        string fContactUser;
        public string ContactUser
        {
            get { return fContactUser; }
            set { SetPropertyValue<string>("ContactUser", ref fContactUser, value); }
        }
        string fContactPhone;
        public string ContactPhone
        {
            get { return fContactPhone; }
            set { SetPropertyValue<string>("ContactPhone", ref fContactPhone, value); }
        }
        string fEmployeeID1;
        public string EmployeeID1
        {
            get { return fEmployeeID1; }
            set { SetPropertyValue<string>("EmployeeID1", ref fEmployeeID1, value); }
        }
        string fEmployeeID2;
        public string EmployeeID2
        {
            get { return fEmployeeID2; }
            set { SetPropertyValue<string>("EmployeeID2", ref fEmployeeID2, value); }
        }
        decimal fCopeAmount;
        public decimal CopeAmount
        {
            get { return fCopeAmount; }
            set { SetPropertyValue<decimal>("CopeAmount", ref fCopeAmount, value); }
        }
        decimal fLowestAmount;
        public decimal LowestAmount
        {
            get { return fLowestAmount; }
            set { SetPropertyValue<decimal>("LowestAmount", ref fLowestAmount, value); }
        }
        decimal fActualAmount;
        public decimal ActualAmount
        {
            get { return fActualAmount; }
            set { SetPropertyValue<decimal>("ActualAmount", ref fActualAmount, value); }
        }
        int fFlag;
        public int Flag
        {
            get { return fFlag; }
            set { SetPropertyValue<int>("Flag", ref fFlag, value); }
        }
        [Association("Order-OrderDetail"), Aggregated]
        public XPCollection<TB_OrderDetail> OrderDetails
        {
            get { return GetCollection<TB_OrderDetail>("OrderDetails"); }
        }
        [Association("Order-OrderPay"), Aggregated]
        public XPCollection<TB_OrderPay> OrderPays
        {
            get { return GetCollection<TB_OrderPay>("OrderPays"); }
        }
    }
}
